package service

import (
	"gitee.com/jinmingzhi/cdce-service/internal/repository"
	auth2 "gitee.com/jinmingzhi/cdce-service/pkg/auth"
)

var (
	AreaSvc         Area
	BatchTimeSvc    BatchTime
	CourseSvc       Course
	SchoolReportSvc SchoolReport
	UserSvc         User
	PaySvc          Pay
)

func InitGlobal() {
	AreaSvc = NewArea(repository.AreaRepo, repository.AreaSchoolRepo)
	BatchTimeSvc = NewBatchTime(repository.BatchTimeRepo)
	CourseSvc = NewCourse(repository.CourseRepo)
	SchoolReportSvc = NewSchoolReport(repository.SchoolReportRepo, repository.PayRepo)
	UserSvc = NewUser(repository.UserRepo)
	PaySvc = NewPay(repository.PayRepo)

	usersvc := NewUser(repository.UserRepo)
	UserSvc = usersvc
	auth2.Auth = usersvc
}
